import request from '@/config/axios'
import type { GuestTitle } from './types'

export const getGuestTitlesListApi = (params: any): Promise<IResponse> => {
  return request.get({ url: '/guest-titles', params })
}

export const createGuestTitlesApi = (data: Partial<GuestTitle>): Promise<IResponse> => {
  return request.post({ url: '/guest-titles', data })
}

export const updateGuestTitlesApi = (id: string, data: Partial<GuestTitle>): Promise<IResponse> => {
  return request.put({ url: `/guest-titles/id/${id}`, data })
}

export const getGuestTitlesDetailApi = (id: string): Promise<IResponse<GuestTitle>> => {
  return request.get({ url: `/guest-titles/id/${id}` })
}

export const delGuestTitlesListApi = (ids: string[] | number[]): Promise<IResponse> => {
  return request.delete({ url: `/guest-titles/id/${ids[0]}` })
}
